package com.lyb.hrm.doc;

import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

@Document(indexName = "hrm",type = "course")
public class CourseDoc {
    //文档的ID，同时也是数据的id
    @Id
    private Long id;
    //标题
    @Field(type =FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    private String name;
    //适用人群
    @Field(type =FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    private String users;
    //课程类型ID
    @Field(type = FieldType.Long)
    private Long courseTypeId;
    //等级名字
    //@Field(type = FieldType.Keyword)
    private String gradeName;
    //课程等级
    private Long gradeId;
    //机构id
    private Long tenantId;
    //机构名字
    @Field(type =FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    private String tenantName;
    //开课时间
    private Date startTime;
    //结课时间
    private Date endTime;
    //封面
    private String pic;
    //免费、收费
    private String chargeName;
    //qq
    private String qq;
    //价格
    private Float price;
    //原价
    private Float priceOld;
    //课程介绍
    private String description;
    //上线时间
    private Date onlineDate = new Date();
    //浏览数
    private Integer viewCount;
    //购买数
    private Integer buyCount;


    @Override
    public String toString() {
        return "CourseDoc{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", users='" + users + '\'' +
                ", courseTypeId=" + courseTypeId +
                ", gradeName='" + gradeName + '\'' +
                ", gradeId=" + gradeId +
                ", tenantId=" + tenantId +
                ", tenantName='" + tenantName + '\'' +
                ", startTime=" + startTime +
                ", endTime=" + endTime +
                ", pic='" + pic + '\'' +
                ", chargeName='" + chargeName + '\'' +
                ", qq='" + qq + '\'' +
                ", price=" + price +
                ", priceOld=" + priceOld +
                ", description='" + description + '\'' +
                ", onlineDate=" + onlineDate +
                ", viewCount=" + viewCount +
                ", buyCount=" + buyCount +
                '}';
    }

    public String getUsers() {
        return this.users;
    }

    public void setUsers(final String users) {
        this.users = users;
    }

    public Long getGradeId() {
        return this.gradeId;
    }

    public void setGradeId(final Long gradeId) {
        this.gradeId = gradeId;
    }

    public Long getTenantId() {
        return this.tenantId;
    }

    public void setTenantId(final Long tenantId) {
        this.tenantId = tenantId;
    }

    public String getTenantName() {
        return this.tenantName;
    }

    public void setTenantName(final String tenantName) {
        this.tenantName = tenantName;
    }

    public Date getStartTime() {
        return this.startTime;
    }

    public void setStartTime(final Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return this.endTime;
    }

    public void setEndTime(final Date endTime) {
        this.endTime = endTime;
    }

    public String getPic() {
        return this.pic;
    }

    public void setPic(final String pic) {
        this.pic = pic;
    }

    public String getChargeName() {
        return this.chargeName;
    }

    public void setChargeName(final String chargeName) {
        this.chargeName = chargeName;
    }

    public String getQq() {
        return this.qq;
    }

    public void setQq(final String qq) {
        this.qq = qq;
    }

    public Float getPrice() {
        return this.price;
    }

    public void setPrice(final Float price) {
        this.price = price;
    }

    public Float getPriceOld() {
        return this.priceOld;
    }

    public void setPriceOld(final Float priceOld) {
        this.priceOld = priceOld;
    }

    public String getDescription() {
        return this.description;
    }

    public void setDescription(final String description) {
        this.description = description;
    }

    public Date getOnlineDate() {
        return this.onlineDate;
    }

    public void setOnlineDate(final Date onlineDate) {
        this.onlineDate = onlineDate;
    }

    public Integer getViewCount() {
        return this.viewCount;
    }

    public void setViewCount(final Integer viewCount) {
        this.viewCount = viewCount;
    }

    public Integer getBuyCount() {
        return this.buyCount;
    }

    public void setBuyCount(final Integer buyCount) {
        this.buyCount = buyCount;
    }

    public Long getCourseTypeId() {
        return this.courseTypeId;
    }

    public void setCourseTypeId(final Long courseTypeId) {
        this.courseTypeId = courseTypeId;
    }

    public Long getId() {
        return this.id;
    }

    public void setId(final Long id) {
        this.id = id;
    }

    public String getName() {
        return this.name;
    }

    public void setName(final String name) {
        this.name = name;
    }

    public String getGradeName() {
        return this.gradeName;
    }

    public void setGradeName(final String gradeName) {
        this.gradeName = gradeName;
    }
}
